﻿using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeonLampTest.Common
{
    public class RightNode : SurroundNodeBase
    {
        public RightNode()
        {
        }
        public override bool IsNext => Displacement>= Height;
        public override void Change()
        {
            Y = 0;
            X = Width - SurroundWidth;
            Displacement += Step;
            if (Displacement > Height)
                Displacement = Height;
            ChangeEndColor();
        }

        public override void Draw(Graphics g)
        {
            Rectangle rectangle = new Rectangle(X, Y, SurroundWidth, Displacement);
            using (LinearGradientBrush bh = new LinearGradientBrush(rectangle, EndColor , StartColor, LinearGradientMode.Vertical))
            {
                g.FillRectangle(bh, rectangle);
            }
        }
    }
}
